Skip to content

ci: Add a dist profile with optimised binary size#6101

Merged
jmartinesp merged 3 commits intomainfrom
misc/customise-release-profile
Feb 4, 2026
Merged

ci: Add a dist profile with optimised binary size#6101
jmartinesp merged 3 commits intomainfrom
misc/customise-release-profile

Conversation

@jmartinesp
Copy link
Contributor

@jmartinesp jmartinesp commented Feb 2, 2026

Changes:

  • Adds a new dist profile that can be used by the bindings to generate library versions with optimised binary size. This was specially a pain point for Android: with this config and some debug symbol stripping, the library size is now 50-70MB smaller per architecture, resulting in very significant file size reduction for universal APKs, which have 4 archs.
  • Also create new reldev profile for FFI bindings consumers that allows having way smaller binaries while still being able to have proper backtraces: reldbg is great for iOS because it allows inline debugging using LLDB in Xcode, but it produces enormous binaries (last I checked was 1.25GB), while for Android we can't use that properly and we'd only be interested in having symbolicated backtraces, which this profile achieves with binaries an order of magnitude smaller.

I'm aware reldev is quite easy to mistake wirh reldbg, so I'm open to finding a better name for it 😅 .

  • Public API changes documented in changelogs (optional)

Signed-off-by:

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 2, 2026

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing misc/customise-release-profile (916d431) with main (1152eb6)

Open in CodSpeed

This is intended for reducing the binary size of the SDK distributed in Android/iOS bindings.

Its optimization level is 'binary size', it contains LTO optimizations and by default removes part of the debug info - the rest can be removed later if needed.
This makes it possible to link a Sentry trace to the debug symbols so it can be symbolicated
@jmartinesp jmartinesp force-pushed the misc/customise-release-profile branch from 79ab3d0 to fe67c20 Compare February 3, 2026 13:02
@jmartinesp jmartinesp changed the title refactor: Remove debuginfo for reldbg and release profiles ci: Add a dist profile with optimised binary size Feb 3, 2026
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.84%. Comparing base (40c6c33) to head (916d431).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6101   +/-   ##
=======================================
  Coverage   89.84%   89.84%           
=======================================
  Files         363      363           
  Lines      100638   100638           
  Branches   100638   100638           
=======================================
+ Hits        90420    90422    +2     
+ Misses       6690     6688    -2     
  Partials     3528     3528           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jmartinesp jmartinesp marked this pull request as ready for review February 3, 2026 19:05
@jmartinesp jmartinesp requested a review from a team as a code owner February 3, 2026 19:05
@jmartinesp jmartinesp requested review from Hywan and removed request for a team February 3, 2026 19:05
Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! A tiny feedback but I'm approving ahead of time to save one review trip.

Cargo.toml Outdated
debug = 0

# Profile for debug builds with full optimization and minimal debug symbols.
# This should be just enough to have proper backtraces, having way smaller binaries.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the difference between reldev and reldbg from a developer point of view please?

It allows having way smaller binaries while still being able to have proper backtraces: `reldbg` is great for iOS because it allows inline debugging using LLDB in Xcode, but it produces enormous binaries, while for Android we can't use that properly and we'd only be interested in having symbolicated backtraces, which this profile achieves with binaries an order of magnitude smaller.
@jmartinesp jmartinesp force-pushed the misc/customise-release-profile branch from a127ed6 to 916d431 Compare February 4, 2026 08:50
@Hywan
Copy link
Member

Hywan commented Feb 4, 2026

Great comment, thanks!

@jmartinesp jmartinesp enabled auto-merge (rebase) February 4, 2026 09:05
@jmartinesp jmartinesp merged commit bb42036 into main Feb 4, 2026
54 checks passed
@jmartinesp jmartinesp deleted the misc/customise-release-profile branch February 4, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants